<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="vue-2.4.0.js"></script>
    <script src="node_modules/_axios@0.18.0@axios/dist/axios.min.js"></script>
</head>

<body>

    <div id="app">


        <mybaby v-for="(item,index) in list" v-bind:todo="item" v-bind:key="index"></mybaby>


    </div>
    <template id="count">
        <div>
            <p>{{todo.age}}</p>
            <span>{{todo.name}}</span>
        </div>
    </template>
    <script>
        axios.get('http://www.lovegf.cn:8899/api/getprodlist')
            .then(function(response) {
                // handle success
                console.log(response);
            })
            .catch(function(error) {
                // handle error
                console.log(error);
            })
            .then(function() {
                // always executed
            });




        Vue.component("mybaby", {
                props: ["todo"],
                template: "#count"
            }),
            new Vue({
                el: "#app",
                data: {
                    list: [{
                        id: 1,
                        name: "天明",
                        age: 14,
                        sex: "男",
                    }, {
                        id: 2,
                        name: "少羽",
                        age: 16,
                        sex: "男",
                    }, {
                        id: 3,
                        name: "石兰",
                        age: 15,
                        sex: "女"
                    }]
                },
                methods: {

                },
            })
    </script>
</body>

</html>